<template>
  <div class="field_setting_box">
    <p>允许外勤卡打
      <el-switch
        v-model="isOut">
      </el-switch>
    </p>
    <p v-if="isOut">
      <el-checkbox v-model="outIsRemark">外勤打卡需填写备注</el-checkbox>
    </p>
    <p v-if="isOut">
      <el-checkbox v-model="outIsPic">外勤打卡需拍照</el-checkbox>
    </p>
  </div>
</template>

<script>

export default {
  props: ['config'],
  name: "editRule",
  components: {},
  data() {
    return {
      isOut: true,
      outIsRemark: true,
      outIsPic: true
    }
  },
  mounted() {
    if (this.config) {
      this.isOut = this.config.isOut?true:false
      this.outIsRemark = this.config.outIsRemark?true:false
      this.outIsPic = this.config.outIsPic?true:false
    }
  },
  methods: {
    submit() {
      this.$emit('checkRuleGet', {
        type: 'field_settings',
        data: {
          isOut: this.isOut,
          outIsRemark: this.outIsRemark,
          outIsPic: this.outIsPic
        }
      })
    }
  }
}
</script>

<style scoped>
.field_setting_box p {
  font-size: 14px;
}
</style>
